package com.atguigu.gulimall.search.feign;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.search.feign.fallback.ProductFeignServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 远程商品服务
 *
 * @author XiaoPing
 * @create 2020/6/27 19:56
 * @since 1.0.0
 */
@FeignClient(value = "gulimall-product",fallback = ProductFeignServiceFallBack.class)
public interface ProductFeignService {

    /**
     * 通过id查询属性信息
     * @param attrId
     * @return
     */
    @GetMapping("/product/attr/info/{attrId}")
    R attrInfo(@PathVariable("attrId") Long attrId);

    /**
     * 通过id查询品牌信息
     * @param branIds
     * @return
     */
    @GetMapping("/product/brand/infos")
    R brandInfo(@RequestParam("branIds") List<Long> branIds);

}
